<template>
 <div>
  <h1 v-text="msg" ref="title"></h1>
    <button ref="btn" @click="showDom">点我输出上方的DOM元素</button>
  <School ref="sch" id="sch" />
 </div>
</template>

<script>
import School from './components/School'
export default {
  name: "App",
  components: {School},
  data() {
   return {
     msg: '欢迎你'
   }
  },
  methods: {
    showDom() {
      console.log(this.$refs) // 获取所有ref 真实DOM元素
      console.log(document.getElementById("sch")) // 获取的是整个School组件内的所有结构
    }
  }
}
</script>

<style scoped>
</style>